package org.hxzon.rpggame;

import org.hxzon.rpggame.util.ScriptEngineUtil;

public class RpggameServerBooter {

    public static void main(String[] args) {
        //
        String cmdPath = args[0];
        String[] files = new String[] { "kobj.js", "def-const.js", "init.js",// 
                "db-and-dao.js", "admcmd.js", "go-and-comp.js",//
                "dao", "comp", "admcmd", "cmd", "server.js" };
        ScriptEngineUtil.loadScripts(cmdPath, files);
        //
//        loadDef();

    }

//    private static void loadDef() {
//        File defDerectory = new File("def");
//        logger.debug(defDerectory.getAbsolutePath());
//        Collection<File> defFiles = FileUtils.listFiles(defDerectory, new String[] { "def" }, true);
//        for (File defFile : defFiles) {
//            try {
//                String defStr = FileUtils.readFileToString(defFile, Util.encoding);
//                JSONObject json = JSON.parseObject(defStr);
//                Def def = new Def(json);
//                ScriptEngineUtil.invoke("addDef", def);
//            } catch (IOException e) {
//                logger.error("", e);
//            }
//        }
//    }

}
